package algotithm.interview.神策数据test.test1;

import java.io.*;

/**
 * @author zhouyanxiang
 * @Date 2021-03-2021/3/1-22:51
 * 40%
 *
 * 5
 * [1,2,3,4,5]
 * 2
 * 6
 *
 * 3 4 5 4 3 2
 */
public class  Main{

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(reader.readLine());
        int[] arr = new int[n];
        String[] str = reader.readLine().split(" ");
        for (int i = 0; i < str.length; i++) {
            arr[i] = Integer.parseInt(str[i]);
        }
        int start = Integer.parseInt(reader.readLine());
        int num = Integer.parseInt(reader.readLine());
        for (int i = start; i < start + num; i++) {
            if (((i) / (n)) % 2 == 0) {
                writer.write(arr[i%n] + "\n");
            } else {
                writer.write(arr[(i-start)%n] + "\n");
            }
        }

        writer.flush();
        writer.close();
        reader.close();
    }


}
